package io.renren.modules.wcs.listenSlaveDB.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.exception.RRException;
import io.renren.datasource.annotation.DataSource;
import io.renren.modules.wcs.listenSlaveDB.entity.TestEntity2;
import io.renren.modules.wcs.listenSlaveDB.service.TestService;
import io.renren.modules.wcs.listenSlaveDB.dao.TestDaos;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 蔡翔
 * @Date: 2019/9/26 14:32
 * @Version 1.0
 */

@Service
@DataSource("slave1")
public class TestServiceImpl extends ServiceImpl<TestDaos, TestEntity2> implements TestService {

    @Autowired
    TestDaos testDaos;

    @Override
    public Integer deleteByNames(List<String> names) {
        Integer a = testDaos.deleteByNames(names);
        return a;
    }

    @Override
    public Integer getCount() {
        Integer a = testDaos.selectCount();
        throw new RRException("自定义异常");

    }
}
